import random
import time

# print(ord('A'), ord('Z'))  # 65 90
# print(ord('a'), ord('z'))  # 65 90
# print(chr(65), chr(90))  # A Z
# 生成一个随机字母组成的列表
a = []
n = 5
for i in range(20):
    s = ''
    for j in range(n):
        c = random.randint(65, 90)
        s += chr(c)
    a.append(s)


def random_char(upper):
    # 生成一个随机字母组成的列表
    if upper:
        s = random.randint(ord('A'), ord('Z'))   # 65 90
        return chr(s)
    else:
        s = random.randint(ord('a'), ord('z'))  # 65 90
        return chr(s)


'''
    生成一段随机字母
    n:字母个数
    upper：是否大写，默认大写字母
'''
def random_string(n, upper=True):
    s = ''
    for j in range(n):
        s += random_char(upper)
    return s

# 获取验证码
def verfity_code(length):
    return random_string(length, False)


# 日期
def get_time():
    s = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())
    return s


def main():
    a = []
    for i in range(20):
        # 随机字母条，3-6个字母
        s = random_string(random.randint(3, 6), False)
        a.append(s)
    print(a)



# main()
